
//
//  AboutUSViewController.swift
//  StudyChinese
//
//  Created by Wenzhe Fan on 2019/7/2.
//  Copyright © 2019年 Wenzhe Fan. All rights reserved.
//

import UIKit
import SafariServices


class AboutUSViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
extension AboutUSViewController:UITableViewDelegate,UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 4
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "AboutCell")
        switch  indexPath.row {
        case 0:
            cell?.textLabel?.text =  "隐私协议"
            break
        case 1:
            cell?.textLabel?.text =  "使用说明"
            break
        case 2:
            cell?.textLabel?.text =  "用户协议"
        
            break
        case 3:
            cell?.textLabel?.text =  "技术支持"
            break
        default:
            break
        }
        return cell!
    }
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        switch indexPath.row {
        case 0:
            let safari = SFSafariViewController(url:URL.init(string:"https://www.jianshu.com/p/16ebfe81c034")!)
            self.present(safari, animated: true, completion: nil)
            break
        case 1:
            let safari = SFSafariViewController(url:URL.init(string:"https://www.jianshu.com/p/16ebfe81c034")!)
            self.present(safari, animated: true, completion: nil)
            break
        case 2:
            let safari = SFSafariViewController(url:URL.init(string:"https://www.jianshu.com/p/16ebfe81c034")!)
            self.present(safari, animated: true, completion: nil)
            break
        case 3:
            //
            let safari = SFSafariViewController(url:URL.init(string:"https://www.jianshu.com/p/16ebfe81c034")!)
            self.present(safari, animated: true, completion: nil)
            break
        default:
            break
        }
    }
    
}
